home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 1.iso / util / tgrep20.zip / CONFIGUR < prev    next >
Text File  |  1994-03-29  |  21KB  |  826 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. # Needed for some versions of `tr' so that character classes in `[]' work.
  84. if test "${LANG+set}" = "set" ; then
  85.    LANG=C
  86. fi
  87.  
  88. rm -f conftest*
  89. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  90.  
  91. # A filename unique to this package, relative to the directory that
  92. # configure is in, which we can look for to find out if srcdir is correct.
  93. unique_file=grep.c
  94.  
  95. # Find the source files, if location was not specified.
  96. if test -z "$srcdir"; then
  97.   srcdirdefaulted=yes
  98.   # Try the directory containing this script, then `..'.
  99.   prog=$0
  100.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  101.   test "X$confdir" = "X$prog" && confdir=.
  102.   srcdir=$confdir
  103.   if test ! -r $srcdir/$unique_file; then
  104.     srcdir=..
  105.   fi
  106. fi
  107. if test ! -r $srcdir/$unique_file; then
  108.   if test x$srcdirdefaulted = xyes; then
  109.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  110.   else
  111.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  112.   fi
  113.   exit 1
  114. fi
  115. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  116. # But we can't avoid them for `..', to make subdirectories work.
  117. case $srcdir in
  118.   .|/*|~*) ;;
  119.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  120. esac
  121.  
  122. for p in mawk gawk nawk awk
  123. do
  124. if test -z "$AWK"; then
  125.   # Extract the first word of `$p', so it can be a program name with args.
  126.   set dummy $p; word=$2
  127.   echo checking for $word
  128.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  129.   for dir in $PATH; do
  130.     test -z "$dir" && dir=.
  131.     if test -f $dir/$word; then
  132.       AWK="$p"
  133.       break
  134.     fi
  135.   done
  136.   IFS="$saveifs"
  137. fi
  138.  
  139. test -n "$AWK" -a -n "$verbose" && echo "    setting AWK to $AWK"
  140.  
  141. test -n "$AWK" && break
  142. done
  143.  
  144. if test -z "$CC"; then
  145.   # Extract the first word of `gcc', so it can be a program name with args.
  146.   set dummy gcc; word=$2
  147.   echo checking for $word
  148.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  149.   for dir in $PATH; do
  150.     test -z "$dir" && dir=.
  151.     if test -f $dir/$word; then
  152.       CC="gcc"
  153.       break
  154.     fi
  155.   done
  156.   IFS="$saveifs"
  157. fi
  158. test -z "$CC" && CC="cc"
  159. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  160.  
  161. # Find out if we are using GNU C, under whatever name.
  162. cat > conftest.c <<EOF
  163. #ifdef __GNUC__
  164.   yes
  165. #endif
  166. EOF
  167. ${CC-cc} -E conftest.c > conftest.out 2>&1
  168. if egrep yes conftest.out >/dev/null 2>&1; then
  169.   GCC=1 # For later tests.
  170. fi
  171. rm -f conftest*
  172.  
  173. echo checking for POSIXized ISC
  174. if test -d /etc/conf/kconfig.d &&
  175.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  176. then
  177.   ISC=1 # If later tests want to check for ISC.
  178.   {
  179. test -n "$verbose" && \
  180. echo '    defining' _POSIX_SOURCE
  181. DEFS="$DEFS -D_POSIX_SOURCE=1"
  182. }
  183.  
  184.   if test -n "$GCC"; then
  185.     CC="$CC -posix"
  186.   else
  187.     CC="$CC -Xp"
  188.   fi
  189. fi
  190.  
  191. echo checking how to run the C preprocessor
  192. if test -z "$CPP"; then
  193.   CPP='${CC-cc} -E'
  194.   cat > conftest.c <<EOF
  195. #include <stdio.h>
  196. EOF
  197. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  198. if test -z "$err"; then
  199.   :
  200. else
  201.   CPP=/lib/cpp
  202. fi
  203. rm -f conftest*
  204. fi
  205.  
  206. # Make sure to not get the incompatible SysV /etc/install and
  207. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  208. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  209. # or the AFS install, which mishandles nonexistent args, or
  210. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  211. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  212. # anyway.  Sigh.
  213. if test "z${INSTALL}" = "z" ; then
  214.   echo checking for install
  215.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  216.   for dir in $PATH; do
  217.     test -z "$dir" && dir=.
  218.     case $dir in
  219.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  220.     *)
  221.       if test -f $dir/installbsd; then
  222.     INSTALL="$dir/installbsd -c" # OSF1
  223.     INSTALL_PROGRAM='$(INSTALL)'
  224.     INSTALL_DATA='$(INSTALL) -m 644'
  225.     break
  226.       fi
  227.       if test -f $dir/install; then
  228.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  229.       : # AIX
  230.     else
  231.       INSTALL="$dir/install -c"
  232.       INSTALL_PROGRAM='$(INSTALL)'
  233.       INSTALL_DATA='$(INSTALL) -m 644'
  234.       break
  235.     fi
  236.       fi
  237.       ;;
  238.     esac
  239.   done
  240.   IFS="$saveifs"
  241. fi
  242. INSTALL=${INSTALL-cp}
  243. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  244. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  245.  
  246. echo checking for ANSI C header files
  247. cat > conftest.c <<EOF
  248. #include <stdlib.h>
  249. #include <stdarg.h>
  250. #include <string.h>
  251. #include <float.h>
  252. EOF
  253. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  254. if test -z "$err"; then
  255.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  256. echo '#include <string.h>' > conftest.c
  257. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  258. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  259.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  260. cat > conftest.c <<EOF
  261. #include <ctype.h>
  262. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  263. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  264. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  265. int main () { int i; for (i = 0; i < 256; i++)
  266. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  267. exit (0); }
  268.  
  269. EOF
  270. eval $compile
  271. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  272.   {
  273. test -n "$verbose" && \
  274. echo '    defining' STDC_HEADERS
  275. DEFS="$DEFS -DSTDC_HEADERS=1"
  276. }
  277.  
  278. fi
  279. rm -f conftest*
  280. fi
  281. rm -f conftest*
  282.  
  283. fi
  284. rm -f conftest*
  285.  
  286. for hdr in string.h sys/param.h
  287. do
  288. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  289. echo checking for ${hdr}
  290. cat > conftest.c <<EOF
  291. #include <${hdr}>
  292. EOF
  293. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  294. if test -z "$err"; then
  295.   {
  296. test -n "$verbose" && \
  297. echo '    defining' ${trhdr}
  298. DEFS="$DEFS -D${trhdr}=1"
  299. }
  300.  
  301. fi
  302. rm -f conftest*
  303. done
  304.  
  305. echo checking whether string.h declares mem functions
  306. echo '#include <string.h>' > conftest.c
  307. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  308. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  309.   :
  310. else
  311.   echo checking for memory.h
  312. cat > conftest.c <<EOF
  313. #include <memory.h>
  314. EOF
  315. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  316. if test -z "$err"; then
  317.   {
  318. test -n "$verbose" && \
  319. echo '    defining' NEED_MEMORY_H
  320. DEFS="$DEFS -DNEED_MEMORY_H=1"
  321. }
  322.  
  323. fi
  324. rm -f conftest*
  325.  
  326. fi
  327. rm -f conftest*
  328.  
  329.  
  330. echo checking for unistd.h
  331. cat > conftest.c <<EOF
  332. #include <unistd.h>
  333. EOF
  334. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  335. if test -z "$err"; then
  336.   {
  337. test -n "$verbose" && \
  338. echo '    defining' HAVE_UNISTD_H
  339. DEFS="$DEFS -DHAVE_UNISTD_H=1"
  340. }
  341.  
  342. fi
  343. rm -f conftest*
  344.  
  345. echo checking for size_t in sys/types.h
  346. echo '#include <sys/types.h>' > conftest.c
  347. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  348. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  349.   :
  350. else
  351.   {
  352. test -n "$verbose" && \
  353. echo '    defining' size_t to be 'unsigned'
  354. DEFS="$DEFS -Dsize_t=unsigned"
  355. }
  356.  
  357. fi
  358. rm -f conftest*
  359.  
  360. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  361. # for constant arguments.  Useless!
  362. echo checking for working alloca.h
  363. cat > conftest.c <<EOF
  364. #include <alloca.h>
  365. int main() { exit(0); }
  366. int t() { char *p = alloca(2 * sizeof(int)); }
  367. EOF
  368. if eval $compile; then
  369.   {
  370. test -n "$verbose" && \
  371. echo '    defining' HAVE_ALLOCA_H
  372. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  373. }
  374.  
  375. fi
  376. rm -f conftest*
  377.  
  378. decl="#ifdef __GNUC__
  379. #define alloca __builtin_alloca
  380. #else
  381. #if HAVE_ALLOCA_H
  382. #include <alloca.h>
  383. #else
  384. #ifdef _AIX
  385.  #pragma alloca
  386. #else
  387. char *alloca ();
  388. #endif
  389. #endif
  390. #endif
  391. "
  392. echo checking for alloca
  393. cat > conftest.c <<EOF
  394. $decl
  395. int main() { exit(0); }
  396. int t() { char *p = (char *) alloca(1); }
  397. EOF
  398. if eval $compile; then
  399.   :
  400. else
  401.   alloca_missing=1
  402. cat > conftest.c <<EOF
  403.  
  404. #if defined(CRAY) && ! defined(CRAY2)
  405. winnitude
  406. #else
  407. lossage
  408. #endif
  409.  
  410. EOF
  411. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  412. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  413.   echo checking for _getb67
  414. cat > conftest.c <<EOF
  415. #include <ctype.h>
  416. int main() { exit(0); }
  417. int t() { 
  418. /* The GNU C library defines this for functions which it implements
  419.     to always fail with ENOSYS.  Some functions are actually named
  420.     something starting with __ and the normal name is an alias.  */
  421. #if defined (__stub__getb67) || defined (__stub____getb67)
  422. choke me
  423. #else
  424. /* Override any gcc2 internal prototype to avoid an error.  */
  425. extern char _getb67(); _getb67();
  426. #endif
  427.  }
  428. EOF
  429. if eval $compile; then
  430.   {
  431. test -n "$verbose" && \
  432. echo '    defining' CRAY_STACKSEG_END to be '_getb67'
  433. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  434. }
  435.  
  436. else
  437.   echo checking for GETB67
  438. cat > conftest.c <<EOF
  439. #include <ctype.h>
  440. int main() { exit(0); }
  441. int t() { 
  442. /* The GNU C library defines this for functions which it implements
  443.     to always fail with ENOSYS.  Some functions are actually named
  444.     something starting with __ and the normal name is an alias.  */
  445. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  446. choke me
  447. #else
  448. /* Override any gcc2 internal prototype to avoid an error.  */
  449. extern char GETB67(); GETB67();
  450. #endif
  451.  }
  452. EOF
  453. if eval $compile; then
  454.   {
  455. test -n "$verbose" && \
  456. echo '    defining' CRAY_STACKSEG_END to be 'GETB67'
  457. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  458. }
  459.  
  460. else
  461.   echo checking for getb67
  462. cat > conftest.c <<EOF
  463. #include <ctype.h>
  464. int main() { exit(0); }
  465. int t() { 
  466. /* The GNU C library defines this for functions which it implements
  467.     to always fail with ENOSYS.  Some functions are actually named
  468.     something starting with __ and the normal name is an alias.  */
  469. #if defined (__stub_getb67) || defined (__stub___getb67)
  470. choke me
  471. #else
  472. /* Override any gcc2 internal prototype to avoid an error.  */
  473. extern char getb67(); getb67();
  474. #endif
  475.  }
  476. EOF
  477. if eval $compile; then
  478.   {
  479. test -n "$verbose" && \
  480. echo '    defining' CRAY_STACKSEG_END to be 'getb67'
  481. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  482. }
  483.  
  484. fi
  485. rm -f conftest*
  486.  
  487. fi
  488. rm -f conftest*
  489.  
  490. fi
  491. rm -f conftest*
  492.  
  493. fi
  494. rm -f conftest*
  495.  
  496.  
  497. fi
  498. rm -f conftest*
  499.  
  500. if test -n "$alloca_missing"; then
  501.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  502.   # that cause trouble.  Some versions do not even contain alloca or
  503.   # contain a buggy version.  If you still want to use their alloca,
  504.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  505.   ALLOCA=alloca.o
  506.  
  507.   echo 'checking stack direction for C alloca'
  508.   echo checking whether cross-compiling
  509. # If we cannot run a trivial program, we must be cross compiling.
  510. cat > conftest.c <<EOF
  511. main(){exit(0);}
  512. EOF
  513. eval $compile
  514. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  515.   :
  516. else
  517.   cross_compiling=1
  518. fi
  519. rm -f conftest*
  520.  
  521. if test -n "$cross_compiling"
  522. then
  523.   {
  524. test -n "$verbose" && \
  525. echo '    defining' STACK_DIRECTION to be '0'
  526. DEFS="$DEFS -DSTACK_DIRECTION=0"
  527. }
  528.  
  529. else
  530. cat > conftest.c <<EOF
  531. find_stack_direction ()
  532. {
  533.   static char *addr = 0;
  534.   auto char dummy;
  535.   if (addr == 0)
  536.     {
  537.       addr = &dummy;
  538.       return find_stack_direction ();
  539.     }
  540.   else
  541.     return (&dummy > addr) ? 1 : -1;
  542. }
  543. main ()
  544. {
  545.   exit (find_stack_direction() < 0);
  546. }
  547. EOF
  548. eval $compile
  549. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  550.   {
  551. test -n "$verbose" && \
  552. echo '    defining' STACK_DIRECTION to be '1'
  553. DEFS="$DEFS -DSTACK_DIRECTION=1"
  554. }
  555.  
  556. else
  557.   {
  558. test -n "$verbose" && \
  559. echo '    defining' STACK_DIRECTION to be '-1'
  560. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  561. }
  562.  
  563. fi
  564. fi
  565. rm -f conftest*
  566. fi
  567.  
  568. for func in getpagesize memchr strerror valloc
  569. do
  570. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  571. echo checking for ${func}
  572. cat > conftest.c <<EOF
  573. #include <ctype.h>
  574. int main() { exit(0); }
  575. int t() { 
  576. /* The GNU C library defines this for functions which it implements
  577.     to always fail with ENOSYS.  Some functions are actually named
  578.     something starting with __ and the normal name is an alias.  */
  579. #if defined (__stub_${func}) || defined (__stub___${func})
  580. choke me
  581. #else
  582. /* Override any gcc2 internal prototype to avoid an error.  */
  583. extern char ${func}(); ${func}();
  584. #endif
  585.  }
  586. EOF
  587. if eval $compile; then
  588.   {
  589. test -n "$verbose" && \
  590. echo '    defining' ${trfunc}
  591. DEFS="$DEFS -D${trfunc}=1"
  592. }
  593.  
  594. fi
  595. rm -f conftest*
  596. done
  597.  
  598. echo checking for unsigned characters
  599. cat > conftest.c <<EOF
  600. /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
  601. #if !__STDC__
  602. #define volatile
  603. #endif
  604. main() {
  605. #ifdef __CHAR_UNSIGNED__
  606.   exit(1); /* No need to redefine it.  */
  607. #else
  608.   volatile char c = 255; exit(c < 0);
  609. #endif
  610. }
  611. EOF
  612. eval $compile
  613. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  614.   {
  615. test -n "$verbose" && \
  616. echo '    defining' __CHAR_UNSIGNED__
  617. DEFS="$DEFS -D__CHAR_UNSIGNED__=1"
  618. }
  619.  
  620. fi
  621. rm -f conftest*
  622.  
  623. prog='/* Ultrix mips cc rejects this.  */
  624. typedef int charset[2]; const charset x;
  625. /* SunOS 4.1.1 cc rejects this.  */
  626. char const *const *ccp;
  627. char **p;
  628. /* AIX XL C 1.02.0.0 rejects this.
  629.    It does not let you subtract one const X* pointer from another in an arm
  630.    of an if-expression whose if-part is not a constant expression */
  631. const char *g = "string";
  632. p = &g + (g ? g-g : 0);
  633. /* HPUX 7.0 cc rejects these. */
  634. ++ccp;
  635. p = (char**) ccp;
  636. ccp = (char const *const *) p;
  637. { /* SCO 3.2v4 cc rejects this.  */
  638.   char *t;
  639.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  640.  
  641.   *t++ = 0;
  642. }
  643. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  644.   int x[] = {25,17};
  645.   const int *foo = &x[0];
  646.   ++foo;
  647. }
  648. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  649.   typedef const int *iptr;
  650.   iptr p = 0;
  651.   ++p;
  652. }
  653. { /* AIX XL C 1.02.0.0 rejects this saying
  654.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  655.   struct s { int j; const int *ap[3]; };
  656.   struct s *b; b->j = 5;
  657. }'
  658. echo checking for working const
  659. cat > conftest.c <<EOF
  660.  
  661. int main() { exit(0); }
  662. int t() { $prog }
  663. EOF
  664. if eval $compile; then
  665.   :
  666. else
  667.   {
  668. test -n "$verbose" && \
  669. echo '    defining' const to be 'empty'
  670. DEFS="$DEFS -Dconst="
  671. }
  672.  
  673. fi
  674. rm -f conftest*
  675.  
  676. echo checking for working mmap
  677. cat > conftest.c <<EOF
  678.  
  679. #include <fcntl.h>
  680. #include <sys/types.h>
  681. #include <sys/mman.h>
  682.  
  683. #ifdef BSD
  684. #ifndef BSD4_1
  685. #define HAVE_GETPAGESIZE
  686. #endif
  687. #endif
  688. #ifndef HAVE_GETPAGESIZE
  689. #include <sys/param.h>
  690. #ifdef EXEC_PAGESIZE
  691. #define getpagesize() EXEC_PAGESIZE
  692. #else
  693. #ifdef NBPG
  694. #define getpagesize() NBPG * CLSIZE
  695. #ifndef CLSIZE
  696. #define CLSIZE 1
  697. #endif /* no CLSIZE */
  698. #else /* no NBPG */
  699. #define getpagesize() NBPC
  700. #endif /* no NBPG */
  701. #endif /* no EXEC_PAGESIZE */
  702. #endif /* not HAVE_GETPAGESIZE */
  703.  
  704. #ifdef __osf__
  705. #define valloc malloc
  706. #endif
  707.  
  708. extern char *valloc();
  709.  
  710. int
  711. main()
  712. {
  713.   char *buf1, *buf2;
  714.   int i = getpagesize(), j;
  715.   int fd;
  716.  
  717.   buf1 = valloc(i);
  718.   buf2 = valloc(i);
  719.   for (j = 0; j < i; ++j)
  720.     *(buf1 + j) = rand();
  721.   fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
  722.   write(fd, buf1, i);
  723.   mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
  724.   for (j = 0; j < i; ++j)
  725.     if (*(buf1 + j) != *(buf2 + j))
  726.       exit(1);
  727.   exit(0);
  728. }
  729.  
  730. EOF
  731. eval $compile
  732. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  733.   {
  734. test -n "$verbose" && \
  735. echo '    defining' HAVE_WORKING_MMAP
  736. DEFS="$DEFS -DHAVE_WORKING_MMAP=1"
  737. }
  738.  
  739. fi
  740. rm -f conftest*
  741. if test -n "$prefix"; then
  742.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  743.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  744. fi
  745. if test -n "$exec_prefix"; then
  746.   prsub="$prsub
  747. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  748. exec_prefix\\1=\\2$exec_prefix%"
  749. fi
  750. DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`"
  751.  
  752. trap 'rm -f config.status; exit 1' 1 3 15
  753. echo creating config.status
  754. rm -f config.status
  755. cat > config.status <<EOF
  756. #!/bin/sh
  757. # Generated automatically by configure.
  758. # Run this file to recreate the current configuration.
  759. # This directory was configured as follows,
  760. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  761. #
  762. # $0 $*
  763.  
  764. for arg
  765. do
  766.   case "\$arg" in
  767.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  768.     exec /bin/sh $0 $* ;;
  769.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  770.   esac
  771. done
  772.  
  773. trap 'rm -f Makefile; exit 1' 1 3 15
  774. AWK='$AWK'
  775. CC='$CC'
  776. CPP='$CPP'
  777. INSTALL='$INSTALL'
  778. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  779. INSTALL_DATA='$INSTALL_DATA'
  780. ALLOCA='$ALLOCA'
  781. LIBS='$LIBS'
  782. srcdir='$srcdir'
  783. DEFS='$DEFS'
  784. prefix='$prefix'
  785. exec_prefix='$exec_prefix'
  786. prsub='$prsub'
  787. EOF
  788. cat >> config.status <<\EOF
  789.  
  790. top_srcdir=$srcdir
  791.  
  792. # Allow make-time overrides of the generated file list.
  793. test -n "$gen_files" || gen_files="Makefile"
  794.  
  795. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  796.   srcdir=$top_srcdir
  797.   # Remove last slash and all that follows it.  Not all systems have dirname.
  798.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  799.   if test "$dir" != "$file"; then
  800.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  801.     test ! -d $dir && mkdir $dir
  802.   fi
  803.   echo creating $file
  804.   rm -f $file
  805.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  806.   sed -e "
  807. $prsub
  808. s%@AWK@%$AWK%g
  809. s%@CC@%$CC%g
  810. s%@CPP@%$CPP%g
  811. s%@INSTALL@%$INSTALL%g
  812. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  813. s%@INSTALL_DATA@%$INSTALL_DATA%g
  814. s%@ALLOCA@%$ALLOCA%g
  815. s%@LIBS@%$LIBS%g
  816. s%@srcdir@%$srcdir%g
  817. s%@DEFS@%$DEFS%
  818. " $top_srcdir/${file}.in >> $file
  819. fi; done
  820.  
  821. exit 0
  822. EOF
  823. chmod +x config.status
  824. test -n "$no_create" || ./config.status
  825.  
  826.